import NProgress from "nprogress";
import "nprogress/nprogress.css";

/**
 * 封装进度条显示
 * @param easing 动画方式
 * @param speed 递增进度条的速度
 * @param showSpinner 是否显示加载ico
 * @param trickleSpeed 自动递增间隔
 * @param minimum 初始化时的最小百分比
 * @returns {*}
 */
export const progress = (easing = "ease", speed = 500, showSpinner = false, trickleSpeed = 20, minimum = 0.3) => {
    return NProgress.configure({
        // 动画方式
        easing: easing,
        // 递增进度条的速度
        speed: speed,
        // 是否显示加载ico
        showSpinner: showSpinner,
        // 自动递增间隔
        trickleSpeed: trickleSpeed,
        // 初始化时的最小百分比
        minimum: minimum
    });
};
